define(function(require, exports, module) {

  var Backbone = require('backbone');
  var $ = require('jquery');
  var _ = require('underscore');
  var jsonview = require('jsonview');
  var tmpl = require('text!../tmpl.html');

  var __ = require('hy5b/frontend/canvas/hline')

  function main() {
    var $app = $('<div id="app">');
    $('#main').html($app);

    $app.append(tmpl);

    var rotation = 0;
    window.setInterval(function() {
      rotation += 3;

      $('#canvas').draw({
        fn: function(ctx) {
          ctx.clearRect(0, 0, $(this).width(), $(this).height());
          ctx.fillStyle = 'rgba(0, 0, 0, 1.0)';
          ctx.fillRect(0, 0, $(this).width(), $(this).height());
        }
      }).drawHLine({
        x: 500,
        y: 300,
        rotation: rotation
      });
    }, 1000 / 60);
  }

  return main;
})
